import React from 'react'
import {useLocation} from "react-router-dom" // 路由传递过来的参数

function Detail() {
   let loaction = useLocation()
   console.log(loaction);
   
  return (
    <div>
        {
                loaction.state &&  loaction.state.detailinfo ? 
                  <div>
                        <img src={loaction.state.detailinfo.detailimg} alt="" />
                          <h4>{loaction.state.detailinfo.info}</h4>
                  </div> :" 您从哪来的呢"
              
        }
      
    </div>
  )
}

export default Detail